const { Sequelize } = require('sequelize');

// mysql -uroot -psdh123 --ssl-cert=/var/lib/mysql/client-cert.pem --ssl-key=/var/lib/mysql/client-key.pem
const sequelize = new Sequelize('mysql', 'root', 'sdh123', {
  host: '192.168.86.134',
  port: 3306,
  dialect: 'mysql', /* 选择 'mysql' | 'mariadb' | 'postgres' | 'mssql' 其一 */
});

;(async function() {
  try {
    await sequelize.authenticate();
    console.log('Connection has been established successfully.');
    // 关闭连接
    sequelize.close()
  } catch (error) {
    console.error('Unable to connect to the database:', error);
  }
})()